﻿// ===============================================================================
//  Copyright © ymind.net. All rights reserved .
//  官方网站：http://ymind.net/
//  版权所有：彦铭工作室 老陈出品
// ===============================================================================

using System;
using Lcsoft.RssEngine.Shared;

namespace Lcsoft.RssEngine.RssChannel
{
	/// <summary>A link and description for a graphic that represent a channel</summary>
	[Serializable]
	public class RssImage : IRssElement
	{
		private string _description = String.Empty;
		private int _height = RssDefault.IntValue;
		private Uri _link = RssDefault.UriValue;
		private string _title = String.Empty;
		private Uri _uri = RssDefault.UriValue;
		private int _width = RssDefault.IntValue;

		/// <summary>The URL of a GIF, JPEG or PNG image that represents the channel.</summary>
		/// <remarks>Maximum length is 500 (For RSS 0.91).</remarks>
		public Uri Url
		{
			get { return this._uri; }
			set { this._uri = RssDefault.Check(value); }
		}

		/// <summary>Describes the image, it's used in the ALT attribute of the HTML img tag when the channel is rendered in HTML.</summary>
		/// <remarks>Maximum length is 100 (For RSS 0.91).</remarks>
		public string Title
		{
			get { return this._title; }
			set { this._title = RssDefault.Check(value); }
		}

		/// <summary>The URL of the site, when the channel is rendered, the image is a link to the site.</summary>
		/// <remarks>Maximum length is 500 (For RSS 0.91).</remarks>
		public Uri Link
		{
			get { return this._link; }
			set { this._link = RssDefault.Check(value); }
		}

		/// <summary>Contains text that is included in the TITLE attribute of the link formed around the image in the HTML rendering.</summary>
		public string Description
		{
			get { return this._description; }
			set { this._description = RssDefault.Check(value); }
		}

		/// <summary>Width of image in pixels</summary>
		/// <remarks>Maximum value for height is 400 (For RSS 0.91)</remarks>
		public int Width
		{
			get { return this._width; }
			set { this._width = RssDefault.Check(value); }
		}

		/// <summary>Height of image in pixels</summary>
		/// <remarks>Maximum value for width is 144 (For RSS 0.91)</remarks>
		public int Height
		{
			get { return this._height; }
			set { this._height = RssDefault.Check(value); }
		}
	}
}
